/*************************************************************************
	> File Name: Visitor.h
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-23 12:10:45
 ************************************************************************/

#ifndef __VISITOR_H__
#define __VISITOR_H__

#include "Element.h"

class Visitor
{
public:
    virtual ~Visitor(){}

    virtual void VisitConcreateElementA(ConcreateElementA * pConcreateElementA) = 0;
    virtual void VisitConcreateElementB(ConcreateElementB * pConcreateElementB) = 0;

protected:
    Visitor(){}
};

class ConcreateVisitorA
:public Visitor
{
public:
    ConcreateVisitorA();
    virtual ~ConcreateVisitorA();

    virtual void VisitConcreateElementA(ConcreateElementA *pConcreateElementA) override;
    virtual void VisitConcreateElementB(ConcreateElementB *pConcreateElementB) override;
};

class ConcreateVisitorB
:public Visitor
{
public:
    ConcreateVisitorB();
    virtual ~ConcreateVisitorB();

    virtual void VisitConcreateElementA(ConcreateElementA *pConcreateElementA) override;
    virtual void VisitConcreateElementB(ConcreateElementB *pConcreateElementB) override;
};

#endif
